<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>

export default {
  name: 'App',
  created() {
    // 当localStorage中存在store，则将原来的store替换
    if (localStorage.getItem('store')) {
      const localStore = JSON.parse(localStorage.getItem('store'));
      for (let key in localStore) {
        this.$store.state[key] = localStore[key];
      }
    }
    window.addEventListener("beforeunload",()=>{
      localStorage.setItem('store',JSON.stringify(this.$store.state));
    })  
  }
}
</script>

<style>
html, body, #app {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-width: 1102px;
  min-height: 720px;
}

a {
  text-decoration:none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 8px;
  background-color: rgb(241, 247, 252);
}

::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  background-color: rgb(241, 247, 252);
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  background-color: #aaaaaa;
}
</style>
